package com.cyj.crm02.controller;

import com.cyj.crm02.entity.Employee;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class PageController {


    @GetMapping("/index")
    public String index(Model model){
        //将用户信息存到model，用于页面显示
        model.addAttribute("employee",(Employee) SecurityUtils.getSubject().getPrincipal());
        return "index";
    }

    @GetMapping("/welcome")
    public String welcome(){
        return "welcome";
    }

    @GetMapping("/403")
    public String un(){
        return "403";
    }
}
